package zookeeper_tool;

import com.google.gson.Gson;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by ibm on 2018/6/25.
 */
public class TestGson
{
    //[{"q":"1","a":"2"},{"q":"1","a":"2"}]
    public static void main(String[] args)
    {
        Gson gson = new Gson();
        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();

        Map<String, Object> map = new HashMap<String, Object>();
        map.put("q", "1");
        map.put("a", "2");


        list.add(map);

        list.add(map);


        System.out.println(gson.toJson(list));


    }
}
